<?php

namespace app\admin\controller;

use think\Request;
use think\Controller;
use think\facade\Db;

class userInformation extends BaseAdmin
{
    //列表
    public function userInformation()
    {
        $userInformation = new \app\admin\model\Reimbursement();
        $res = $userInformation::orderRaw('IFNULL(update_time,create_time) desc')->group('name')->paginate();
        $count = $userInformation::group('name')->count();
        $this->assign(['count'=>$count,'res'=>$res]);
        return view('list');
    }

    //单个用户的详细信息
    public function find(){
        $userInformation = new \app\admin\model\Reimbursement();
        $id = (int)input('id');
        $infoname = $userInformation::where('id',$id)->value('name');
        $res = $userInformation->where('name',$infoname)->paginate(15, false, ['query' => request()->param()]);
        $this->assign(['res'=>$res]);
        $this->assign('empty','<span style="color: #BD1044">没有数据</span>');
        return view('info');
    }

}